API Documentation
GridLayout.h
1 // GridLayout.h
3 //
5 
6 namespace nkWinUi
7 {
13  class DLL_WINUI_EXPORT GridLayout final : public Layout
14  {
15  public :
16 
25 
26  // Getters
31  Component* getComponentAt (unsigned int index) const ;
39  Component* getComponentAt (unsigned int x, unsigned int y) const ;
43  unsigned int getGridWidth () const ;
47  unsigned int getGridHeight () const ;
55 
56  // Setters
60  virtual void setParentComponent (Component* parent) override ;
67  void setGridWidth (unsigned int value) ;
74  void setGridHeight (unsigned int value) ;
80  void insertRow (unsigned int index) ;
86  void insertCol (unsigned int index) ;
92  void eraseRow (unsigned int index) ;
98  void eraseCol (unsigned int index) ;
105  void setFixedSizeRow (unsigned int rowIndex, unsigned int sizePix) ;
112  void setFixedSizeCol (unsigned int colIndex, unsigned int sizePix) ;
122  void setWeightRow (unsigned int rowIndex, float weight) ;
132  void setWeightCol (unsigned int colIndex, float weight) ;
138  void setInternalBorderWidth (unsigned int valuePix) ;
144  void setInternalBorderHeight (unsigned int valuePix) ;
154  void setIgnoreInternalBorderCell (unsigned int rowIndex, unsigned int colIndex, bool value) ;
155 
156  // Components
170  void addComponent (Component* component, int x, int y, int width, int height, bool resizeAllowed = false) ;
183  void updateComponentCellCoverage (Component* component, unsigned int x, unsigned int y, unsigned int width, unsigned int height, bool updateLayout = true) ;
194  virtual void removeComponent (Component* component) override ;
195 
196  // Update
200  virtual void update () override ;
201 
202  // Import / Export
206  virtual void exportClassToTree (nkExport::Node* rootNode) override ;
210  virtual void exportComponentsNodeEntry (nkExport::Node* rootNode) override ;
214  virtual void importClassFromTree (nkExport::Node* rootNode) override ;
218  virtual void processComponentsNodeEntry (nkExport::Node* rootNode) override ;
219  } ;
220 }
nkWinUi::GridLayout::getComponentAt
Component * getComponentAt(unsigned int index) const
nkWinUi::GridLayout::setWeightCol
void setWeightCol(unsigned int colIndex, float weight)
nkWinUi::GridLayout::getCellCoordinatesForPoint
nkMaths::Point getCellCoordinatesForPoint(const nkMaths::Point &point) const
nkWinUi::GridLayout::exportComponentsNodeEntry
virtual void exportComponentsNodeEntry(nkExport::Node *rootNode) override
nkWinUi::GridLayout::exportClassToTree
virtual void exportClassToTree(nkExport::Node *rootNode) override
nkWinUi::GridLayout::importClassFromTree
virtual void importClassFromTree(nkExport::Node *rootNode) override
nkWinUi::GridLayout::getComponentAt
Component * getComponentAt(unsigned int x, unsigned int y) const
nkWinUi::GridLayout::setFixedSizeCol
void setFixedSizeCol(unsigned int colIndex, unsigned int sizePix)
nkWinUi::Layout
Represents a layout to organize sub-windows in a window.
Definition: Layout.h:12
nkWinUi::GridLayout::setFixedSizeRow
void setFixedSizeRow(unsigned int rowIndex, unsigned int sizePix)
nkWinUi::GridLayout::update
virtual void update() override
nkWinUi::GridLayout::~GridLayout
~GridLayout()
nkWinUi::GridLayout::setWeightRow
void setWeightRow(unsigned int rowIndex, float weight)
nkWinUi::Component
Base class for any graphical component.
Definition: Component.h:12
nkWinUi::GridLayout::getGridHeight
unsigned int getGridHeight() const
nkWinUi::GridLayout::setIgnoreInternalBorderCell
void setIgnoreInternalBorderCell(unsigned int rowIndex, unsigned int colIndex, bool value)
nkWinUi::GridLayout::setInternalBorderWidth
void setInternalBorderWidth(unsigned int valuePix)
nkWinUi::GridLayout::getComponentCellCoverage
nkMaths::Rectangle getComponentCellCoverage(Component *component) const
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkWinUi::GridLayout::GridLayout
GridLayout()
nkMaths::Point
Represents a 2D Point.
Definition: Point.h:12
nkWinUi::GridLayout::insertRow
void insertRow(unsigned int index)
nkWinUi::GridLayout::addComponent
void addComponent(Component *component, int x, int y, int width, int height, bool resizeAllowed=false)
nkWinUi::GridLayout::eraseRow
void eraseRow(unsigned int index)
nkWinUi::GridLayout::insertCol
void insertCol(unsigned int index)
nkWinUi::GridLayout::setParentComponent
virtual void setParentComponent(Component *parent) override
nkWinUi::GridLayout::eraseCol
void eraseCol(unsigned int index)
nkWinUi::GridLayout::updateComponentCellCoverage
void updateComponentCellCoverage(Component *component, unsigned int x, unsigned int y, unsigned int width, unsigned int height, bool updateLayout=true)
nkWinUi::GridLayout::setInternalBorderHeight
void setInternalBorderHeight(unsigned int valuePix)
nkMaths::Rectangle
Represents a 2D rectangle.
Definition: Rectangle.h:12
nkWinUi::GridLayout::getGridWidth
unsigned int getGridWidth() const
nkWinUi::GridLayout
Implements a layout organizing children components in a grid.
Definition: GridLayout.h:14
nkWinUi
Encompasses all API of component NilkinsWinUi.
Definition: Button.h:7
nkWinUi::GridLayout::removeComponent
virtual void removeComponent(Component *component) override
nkWinUi::GridLayout::setGridWidth
void setGridWidth(unsigned int value)
nkWinUi::GridLayout::processComponentsNodeEntry
virtual void processComponentsNodeEntry(nkExport::Node *rootNode) override
nkWinUi::GridLayout::setGridHeight
void setGridHeight(unsigned int value)